package model;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Temporal;

@Entity
@Table(name="evento")
@SequenceGenerator(name="evento_id_seq", sequenceName="evento_id_seq", allocationSize=1, initialValue=1 )
public class Evento implements Serializable {
    @Id
    @GeneratedValue(generator="evento_id_seq", strategy=GenerationType.SEQUENCE)
    @Column(name="id", unique=true, nullable=false)
    private Integer id;
    
    @Column(name="descricao", nullable=false, length=60)
    private String descricao;
    
    @Column(name="valor", nullable=false, length=15, precision=2)
    private Double valor;
    
    @Column(name="consumacao", nullable=false, length=15, precision=2)
    private Double consumacao;
    
    @Temporal(javax.persistence.TemporalType.TIMESTAMP)
    private Date inicio;
    
    @Temporal(javax.persistence.TemporalType.TIMESTAMP)
    private Date fim;

    public Evento(Integer id, String descricao, Double valor, Double consumacao, Date inicio, Date fim) {
        this.id = id;
        this.descricao = descricao;
        this.valor = valor;
        this.consumacao = consumacao;
        this.inicio = inicio;
        this.fim = fim;
    }

    public Evento() {
        this(null, "", 0.00, 0.00, null, null);
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getDescricao() {
        return descricao;
    }

    public void setDescricao(String descricao) {
        this.descricao = descricao;
    }

    public Double getValor() {
        return valor;
    }

    public void setValor(Double valor) {
        this.valor = valor;
    }

    public Double getConsumacao() {
        return consumacao;
    }

    public void setConsumacao(Double consumacao) {
        this.consumacao = consumacao;
    }

    public Date getInicio() {
        return inicio;
    }

    public void setInicio(Date inicio) {
        this.inicio = inicio;
    }

    public Date getFim() {
        return fim;
    }

    public void setFim(Date fim) {
        this.fim = fim;
    }   

    @Override
    public String toString() {
        return descricao;
    }
    
    
}
